package com.t168.appinfo.service.background.appinfo.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.t168.appinfo.dao.background.appinfo.BgAppInfoMapper;
import com.t168.appinfo.entity.AppInfo;
import com.t168.appinfo.service.background.appinfo.BgAppInfoService;

@Service("bgAppInfoService")
public class BgAppInfoServiceImpl implements BgAppInfoService {

	@Resource(name = "bgAppInfoMapper")
	private BgAppInfoMapper bgAppInfoMapper;
	
	public BgAppInfoMapper getAppInfoMapper() {
		return bgAppInfoMapper;
	}

	public void setAppInfoMapper(BgAppInfoMapper bgAppInfoMapper) {
		this.bgAppInfoMapper = bgAppInfoMapper;
	}

	@Override
	public List<AppInfo> getAppInfo(String level1, String level2,
			String level3, String softwareName, String flatformId,
			String status, Integer pageIndex, Integer pageCount) {
		// TODO Auto-generated method stub
		int currentNo = ((pageIndex-1)*pageCount);
		return bgAppInfoMapper.getAppInfo(level1, level2, level3, softwareName, flatformId, status, currentNo, pageCount);
	}

	@Override
	public int getAppInfoCount(String level1, String level2, String level3,
			String softwareName, String flatformId, String status) {
		return bgAppInfoMapper.getAppInfoCount(level1, level2, level3, softwareName, flatformId, status);
	}

	@Override
	public AppInfo getAppInfoViewById(int id) {
		
		return bgAppInfoMapper.getAppInfoViewById(id);
	}

	@Override
	public boolean modifyAppInfoStatus(Integer status,Integer appId) {
		boolean flag = false;
		if(bgAppInfoMapper.modifyAppInfoStatus(status,appId) > 0){
			flag = true;
		}
		return flag;
	}

}
